#region Summary 

// 
// Owner : JackieHan 
// 
// Solution : LearnSolution 
// 
// Project : JackieHan.DotNet.ExtensionMethods 
// 
// File : ExtensionContains.cs 
// 
// CopyRight : Copyright © 2009-2010 JackieHan Personal, All Rights Reserved 
// 
// Summary : 扩展Contains方法 
// 
// History : 
//			2010-05-19 16:24:43	    Create 
// 

#endregion

#region Using 

using System;
using System.Collections.Generic;
using System.Linq;

#endregion

namespace JackieHan.DotNet.ExtensionMethods.ExtensionIList
{
    /// <summary> 
    /// 扩展Contains方法 
    /// </summary> 
    public static class ExtensionContains
    {
        public static bool Contains<T>(this IEnumerable<T> list, T item, Func<T, object> keyExtractor)
        {
            return list.Contains(item, new KeyEqualityComparer<T>(keyExtractor));
        }

        public static bool Contains<T>(this IEnumerable<T> list,T item,Func<T,T,bool> comparer)
        {
            return list.Contains(item, new KeyEqualityComparer<T>(comparer));
        }
    }
}
